<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.14.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>PID_Study: E:/STM32CubeIDEWorkspace/noRTOS/PID_Study/Drivers/Algorithm/Inc/kalman_filter.h 文件参考</title>
<link rel="icon" href="Doxygen-55px.png" type="image/x-icon" />
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectlogo"><img alt="Logo" src="Doxygen-55px.png"/></td>
  <td id="projectalign">
   <div id="projectname">PID_Study<span id="projectnumber">&#160;v1.0.0</span>
   </div>
   <div id="projectbrief">doc for PID_Study</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.14.0 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search/",'.html');
</script>
<script type="text/javascript">
$(function() { codefold.init(); });
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','搜索',false);
  $(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">载入中...</div>
<div class="SRStatus" id="Searching">搜索中...</div>
<div class="SRStatus" id="NoMatches">未找到</div>
</div>
</div>
</div>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a href="dir_0c97d201d54b8b5817233953fc3aadb6.html">STM32CubeIDEWorkspace</a></li><li class="navelem"><a href="dir_f3310f12da31771255acec658cd4246d.html">noRTOS</a></li><li class="navelem"><a href="dir_8022218a35d1971722714ae72b00e870.html">PID_Study</a></li><li class="navelem"><a href="dir_17bc370c857333bc4166d76f67bb735c.html">Drivers</a></li><li class="navelem"><a href="dir_e69a281451c2b8e1f92d152816da16da.html">Algorithm</a></li><li class="navelem"><a href="dir_3bdb93e34c040a49dad5fa6bfdf8cbfd.html">Inc</a></li>  </ul>
</div>
</div><!-- top -->
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#nested-classes">结构体</a> &#124;
<a href="#func-members">函数</a>  </div>
  <div class="headertitle"><div class="title">kalman_filter.h 文件参考</div></div>
</div><!--header-->
<div class="contents">

<p>单变量卡尔曼滤波器接口头文件  
<a href="#details">更多...</a></p>
<div class="textblock"><code>#include &quot;main.h&quot;</code><br />
</div>
<p><a href="kalman__filter_8h_source.html">浏览该文件的源代码.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 id="header-nested-classes" class="groupheader"><a id="nested-classes" name="nested-classes"></a>
结构体</h2></td></tr>
<tr class="memitem:Kalman_5FEstimate" id="r_Kalman_5FEstimate"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_kalman___estimate.html">Kalman_Estimate</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">卡尔曼滤波器估计值结构体  <a href="struct_kalman___estimate.html#details">更多...</a><br /></td></tr>
<tr class="memitem:Kalman_5FValue" id="r_Kalman_5FValue"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_kalman___value.html">Kalman_Value</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">卡尔曼滤波器数值结构体  <a href="struct_kalman___value.html#details">更多...</a><br /></td></tr>
<tr class="memitem:Kalman_5FError" id="r_Kalman_5FError"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_kalman___error.html">Kalman_Error</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">卡尔曼滤波器误差结构体  <a href="struct_kalman___error.html#details">更多...</a><br /></td></tr>
<tr class="memitem:Kalman" id="r_Kalman"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_kalman.html">Kalman</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">卡尔曼滤波器主结构体  <a href="struct_kalman.html#details">更多...</a><br /></td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 id="header-func-members" class="groupheader"><a id="func-members" name="func-members"></a>
函数</h2></td></tr>
<tr class="memitem:aff9cf5d84aa5362c33ff4941522fee35" id="r_aff9cf5d84aa5362c33ff4941522fee35"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#aff9cf5d84aa5362c33ff4941522fee35">Kalman_Error_Set</a> (<a class="el" href="struct_kalman.html">Kalman</a> *kalman, float error_estimate, float error_measure)</td></tr>
<tr class="memdesc:aff9cf5d84aa5362c33ff4941522fee35"><td class="mdescLeft">&#160;</td><td class="mdescRight">设置卡尔曼滤波器的误差参数  <br /></td></tr>
<tr class="memitem:a3cb3c8cf683614e67bfdef41496009a4" id="r_a3cb3c8cf683614e67bfdef41496009a4"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a3cb3c8cf683614e67bfdef41496009a4">Kalman_calculate</a> (<a class="el" href="struct_kalman.html">Kalman</a> *kalman, float value_measure)</td></tr>
<tr class="memdesc:a3cb3c8cf683614e67bfdef41496009a4"><td class="mdescLeft">&#160;</td><td class="mdescRight">执行卡尔曼滤波计算  <br /></td></tr>
<tr class="memitem:ab9c55009ab86793c67945c58d5389384" id="r_ab9c55009ab86793c67945c58d5389384"><td class="memItemLeft" align="right" valign="top">float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#ab9c55009ab86793c67945c58d5389384">Kalman_Value_Estimate_Get</a> (<a class="el" href="struct_kalman.html">Kalman</a> kalman)</td></tr>
<tr class="memdesc:ab9c55009ab86793c67945c58d5389384"><td class="mdescLeft">&#160;</td><td class="mdescRight">获取卡尔曼滤波器的当前估计值  <br /></td></tr>
<tr class="memitem:a6adbfe36db2a055bc1f7e4c1150cd4d4" id="r_a6adbfe36db2a055bc1f7e4c1150cd4d4"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a6adbfe36db2a055bc1f7e4c1150cd4d4">Kalman_Init</a> (<a class="el" href="struct_kalman.html">Kalman</a> *kalman, float initial_estimate, float error_estimate, float error_measure)</td></tr>
<tr class="memdesc:a6adbfe36db2a055bc1f7e4c1150cd4d4"><td class="mdescLeft">&#160;</td><td class="mdescRight">初始化卡尔曼滤波器  <br /></td></tr>
</table>
<a name="details" id="details"></a><h2 id="header-details" class="groupheader">详细描述</h2>
<div class="textblock"><p>单变量卡尔曼滤波器接口头文件 </p>
<dl class="section author"><dt>作者</dt><dd>废话文学创始人 </dd></dl>
<dl class="section version"><dt>版本</dt><dd>1.1 </dd></dl>
<dl class="section date"><dt>日期</dt><dd>2024-07-14 </dd></dl>
<dl class="section note"><dt>注解</dt><dd>可实现对单变量的动态跟踪和稳定时的滤波 </dd></dl>
</div><a name="doc-func-members" id="doc-func-members"></a><h2 id="header-doc-func-members" class="groupheader">函数说明</h2>
<a id="a3cb3c8cf683614e67bfdef41496009a4" name="a3cb3c8cf683614e67bfdef41496009a4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a3cb3c8cf683614e67bfdef41496009a4">&#9670;&#160;</a></span>Kalman_calculate()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Kalman_calculate </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_kalman.html">Kalman</a> *</td>          <td class="paramname"><span class="paramname"><em>kalman</em></span>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float</td>          <td class="paramname"><span class="paramname"><em>value_measure</em></span>&#160;)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>执行卡尔曼滤波计算 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in,out]</td><td class="paramname">kalman</td><td>卡尔曼滤波器结构体指针 </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">value_measure</td><td>测量值输入</td></tr>
    <tr><td class="paramdir">[in,out]</td><td class="paramname">kalman</td><td>卡尔曼滤波器结构体指针 </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">value_measure</td><td>测量到的观测值 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section note"><dt>注解</dt><dd>在计算前调用Kalman_Error_Set来设置参数 </dd>
<dd>
在计算前调用Kalman_Value_Measure_Set来奠定基调 </dd></dl>

</div>
</div>
<a id="aff9cf5d84aa5362c33ff4941522fee35" name="aff9cf5d84aa5362c33ff4941522fee35"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aff9cf5d84aa5362c33ff4941522fee35">&#9670;&#160;</a></span>Kalman_Error_Set()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Kalman_Error_Set </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_kalman.html">Kalman</a> *</td>          <td class="paramname"><span class="paramname"><em>kalman</em></span>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float</td>          <td class="paramname"><span class="paramname"><em>error_estimate</em></span>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float</td>          <td class="paramname"><span class="paramname"><em>error_measure</em></span>&#160;)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>设置卡尔曼滤波器的误差参数 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in,out]</td><td class="paramname">kalman</td><td>卡尔曼滤波器结构体指针 </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">error_estimate</td><td>估计误差 </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">error_measure</td><td>测量误差</td></tr>
  </table>
  </dd>
</dl>
<p>设置卡尔曼滤波器的误差参数</p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in,out]</td><td class="paramname">kalman</td><td>卡尔曼滤波器结构体指针 </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">error_estimate</td><td>估计误差 </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">error_measure</td><td>测量误差 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section note"><dt>注解</dt><dd>估计误差动态变化，但会将初始估计误差保留 </dd>
<dd>
观测误差一般保持不变 </dd></dl>

</div>
</div>
<a id="a6adbfe36db2a055bc1f7e4c1150cd4d4" name="a6adbfe36db2a055bc1f7e4c1150cd4d4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a6adbfe36db2a055bc1f7e4c1150cd4d4">&#9670;&#160;</a></span>Kalman_Init()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Kalman_Init </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_kalman.html">Kalman</a> *</td>          <td class="paramname"><span class="paramname"><em>kalman</em></span>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float</td>          <td class="paramname"><span class="paramname"><em>initial_estimate</em></span>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float</td>          <td class="paramname"><span class="paramname"><em>error_estimate</em></span>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float</td>          <td class="paramname"><span class="paramname"><em>error_measure</em></span>&#160;)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>初始化卡尔曼滤波器 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in,out]</td><td class="paramname">kalman</td><td>卡尔曼滤波器结构体指针 </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">initial_estimate</td><td>初始估计值 </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">error_estimate</td><td>初始估计误差 </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">error_measure</td><td>测量误差 </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="ab9c55009ab86793c67945c58d5389384" name="ab9c55009ab86793c67945c58d5389384"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab9c55009ab86793c67945c58d5389384">&#9670;&#160;</a></span>Kalman_Value_Estimate_Get()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">float Kalman_Value_Estimate_Get </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_kalman.html">Kalman</a></td>          <td class="paramname"><span class="paramname"><em>kalman</em></span></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>获取卡尔曼滤波器的当前估计值 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">kalman</td><td>卡尔曼滤波器结构体 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>当前估计值</dd></dl>
<p>获取卡尔曼滤波器的当前估计值</p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">kalman</td><td>卡尔曼滤波器结构体 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>本次计算后的估计值 </dd></dl>
<dl class="section note"><dt>注解</dt><dd>如果实际值不变，估计值应当有收敛的趋势 </dd></dl>

</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
制作者&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.14.0
</small></address>
</div><!-- doc-content -->
</body>
</html>
